package y2015.day_16.列出当前目录所有文件;

import java.io.File;
import java.io.FilenameFilter;


public class FileAccept implements FilenameFilter {
    private String extendName;

    public void setExtendName(String s) {
        extendName = "." + s;
    }

    @Override
    public boolean accept(File dir, String name) {
        return name.endsWith(extendName);//重写方法，是否符合“.java”名结尾
    }
}

